From: Florian Müllner Date: Mon, 29 Jan 2024 16:29:51 +0000 (+0100) Subject: boxpointer: Clamp alignments to expected range X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~281^2~2^2~79 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=d0b23510367285753fb6cba9d47b452c995d0dae;p=gnome-shell.git boxpointer: Clamp alignments to expected range The values are expected to be between 0 (start) and 1 (end), enforce that with appropriate clamp() calls. Part-of: --- diff --git a/js/ui/boxpointer.js b/js/ui/boxpointer.js index 8c410201e..de148fdd0 100644 --- a/js/ui/boxpointer.js +++ b/js/ui/boxpointer.js @@ -446,13 +446,13 @@ export const BoxPointer = GObject.registerClass({ () => (this._sourceActor = null), this); } - this._arrowAlignment = alignment; + this._arrowAlignment = Math.clamp(alignment, 0.0, 1.0); this.queue_relayout(); } setSourceAlignment(alignment) { - this._sourceAlignment = alignment; + this._sourceAlignment = Math.clamp(alignment, 0.0, 1.0); if (!this._sourceActor) return;